package com.java.io.piped;

import java.io.IOException;
import java.io.PipedOutputStream;

/*
 * 消息发送类
 */
public class Sender implements Runnable {
	
	private PipedOutputStream out = null;

	public Sender() {
		this.out = new PipedOutputStream();
	}
	
	@Override
	public void run() {
		try {
			String message = "Hello,reveiver";
			out.write(message.getBytes());
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public PipedOutputStream getOut() {
		return out;
	}
	
}
